/*
 * @lc app=leetcode.cn id=836 lang=typescript
 *
 * [836] 矩形重叠
 */

// @lc code=start
// TODO 几何作业。。。
function isRectangleOverlap(rec1: number[], rec2: number[]): boolean {
    return (
        checkBorder(rec1[0], rec1[2], rec2[0], rec2[2]) &&
        checkBorder(rec1[1], rec1[3], rec2[1], rec2[3])
    );
}
const checkBorder = (a: number, b: number, c: number, d: number) => {
    return a < b && c < d && b > c && d > a;
};

// @lc code=end
